<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<title>JQuery Cookie</title>
<style>
body {
  background-color:#ccc;
  color:black;
  padding:50px;
  font:normal 14px Verdana,Arial,Sans-Serif;
}
a {text-decoration:none;font:bold 10px Arial,Sans-Serif;}
#dialog {
  background-color:#ffa500;
  border:5px solid #222;
  box-shadow:0px 1px 3px black;
  position:absolute;
  top:-100px;
  left:50%;
  width:260px;
  height:140px;
  margin:-70px 0px 0px -150px;
  padding:15px;
  color:white;
}
a.close {
  color:white;
  font:bold 16px Arial,Sans-Serif;
  text-decoration:none;
  position:absolute;
  top:10px;
  right:14px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
// Start JQuery Cookie
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
// End JQuery Cookie

$(function() {
	$(window).load(function() {
		$('#dialog').animate({top:($(window).height()/2)-20}, 400, "swing");
	});
	$('a.close').click(function() {
		$(this).parent().fadeOut('fast', function() {
			$('body').prepend('<h2>Muat ulang halaman ini untuk melihat bahwa kotak dialog tidak akan ditampilkan lagi.</h2>');
		});
		createCookie("hideDialog", null, 7000);
		return false;
	});
	if(readCookie("hideDialog")) {
		$('#dialog').remove();
	}
	$('#clear-cookie').click(function() {
		eraseCookie("hideDialog");
		return false;
	});
});
</script>
</head>
<body>
<div id="dialog">
Tutup kotak dialog ini maka Anda tidak akan pernah melihatnya lagi.
<a class="close" href="#">&#215;</a></div>
<span style="text-align:right;"><a href="http://www.dte.web.id">DTE :]</a> <a id="clear-cookie" href="#">.</a></span>
</body>
</html>